package run;

import javax.swing.UIManager;
import javax.swing.UIManager.LookAndFeelInfo;
import org.java.ayatana.ApplicationMenu;
import org.java.ayatana.AyatanaDesktop;
import vkmc.Settings;

public class Main
{
	public static Gui gui;

	public static void main(String[] args)
	{
		Settings.Initialize();
		try
		{
			if (Settings.isSystemLookAndFeel())
			{
				UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
			}
			else
			{
				UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
				for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels())
				{
					if ("Nimbus".equals(info.getName()))
					{
						UIManager.setLookAndFeel(info.getClassName());
						break;
					}
				}
			}
		}
		catch (Exception e)
		{}
		LanguageLoader.loadLanguages();
		gui = new Gui("VKMediaCrawler", 1000, 800, true);
		if (AyatanaDesktop.isSupported())
			ApplicationMenu.tryInstall(gui);
	}
}
